﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrator/default.master" AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="Administrator_Admin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    Quản lý Quản trị viên
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <h1>
        Danh sách Quản trị viên</h1>
    <table style="width:100%;">
            <tr>
                <td colspan="2">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                <asp:GridView ID="GridView1" runat="server" Width="100%" AllowPaging="True" AutoGenerateColumns="False"
                    BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px"
                    CellPadding="4" CellSpacing="2" DataSourceID="ObjectDataSource1" ForeColor="Black"
                    EnableViewState="False" 
                    EnableModelValidation="True" onrowcommand="GridView1_RowCommand" >
                    <RowStyle BackColor="White" />
                    <Columns>
                        <asp:BoundField DataField="Admin_ID" HeaderText="Admin_ID" 
                            SortExpression="Admin_ID" />
                        <asp:BoundField DataField="Admin_Name" HeaderText="Admin_Name" 
                            SortExpression="Admin_Name" />
                        <asp:BoundField DataField="Admin_Email" HeaderText="Admin_Email" 
                            SortExpression="Admin_Email" />
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:Button ID="btnRoles" runat="server" CausesValidation="false" CommandName="Select"
                                    Text="Show Roles" CommandArgument='<%# Eval("Admin_ID") %>' />
                            </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">                     
                            <ItemTemplate>
                                <asp:Button ID="btnEdit" runat="server" CausesValidation="false" CommandName="Edit"
                                    Text="Edit" CommandArgument='<%# Eval("Admin_ID") %>' />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:Button ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="Delete" OnClientClick="return confirm('Are you sure?');" CommandArgument='<%# Eval("Admin_ID") %>' />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#CCCCCC" />
                    <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td align="right">
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnNew" runat="server" Text="New" onclick="btnNew_Click" 
                        Width="71px" />
                </td>
                <td align="right">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                        SelectMethod="GetAll" TypeName="BusinessLayer.Admin">
                    </asp:ObjectDataSource>
                </td>
            </tr>
        </table>
</asp:Content>

